#! /usr/bin/env python
# -*- coding: utf-8 -*-
import socket

def rpcclient(kw,days):
    sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(('localhost',8700))
    sock.send('~'+kw+':'+str(days)+'~\r\n')
    receive_data=sock.recv(4000)
#    sock.close()
#    print receive_data
    return receive_data
if __name__ == "__main__":
    print rpcclient('iphone4',30)